<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2020/9/24
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>村花</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/Apage/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/Apage/css/home.css">
    <script src="${pageContext.request.contextPath}/static/Apage/js/jquery-3.3.1.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header" style="background-color: #20222A">
        <div class="layui-logo"
             style="background-color: #393D49;color: white;height: 210px;border-bottom: 1px solid white">
            <div style="background-color: #393D49;color: #009E94;font-weight: bolder">村花</div>

            <a href="javascript:void(0)" id="tip" onclick="openHead()" onmouseenter="tip()" >
                <img id="userImg" src="${pageContext.request.contextPath}/static/img/3.jpg"
                     style="width: 90px;height: 90px" class="layui-nav-img">
            </a>
            <div style="font-size: 10px;text-align: center;height: 15px;margin-bottom: 8px;padding-right: 6px">
                lh
            </div>
            <div style="font-size: 10px;padding-right: 10px">
                您好，欢迎登录
            </div>
        </div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">

            <li class="layui-nav-item">
                <div style="float: left">
                    <ul >
                        <li><a class="scrollText"><i
                                class="layui-icon layui-icon-speaker"></i>顾客就是上帝</a>
                        </li>
                    </ul>
                </div>
                <div style="float: right " class="time"><em id="time"></em></div>
            </li>

        </ul>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="" id="refresh">
                <i class="layui-icon layui-icon-refresh"></i></a>
            </li>


            <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/enter/enterInit" onclick="clearCookie()" id="logout"><i
                    class="layui-icon layui-icon-logout"></i>退出</a></li>
        </ul>
    </div>

    <div id="uploadImg">
        <h1>修改</h1>
    </div>

    <div class="layui-side layui-bg-black" style="padding-top: 150px">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="test">

                <li class="layui-nav-item" id="userManage" style="text-align: center">
                    <a href="#" data-url="${pageContext.request.contextPath}/admin/adminInit" data-id="1" data-title="管理员" class="site-demo-active"
                       data-type="tabAdd">
                        <i class="layui-icon layui-icon-username"></i>管理员
                    </a>
                </li>
                <li class="layui-nav-item" id="class" style="text-align: center">
                    <a href="#"  data-url="${pageContext.request.contextPath}/log/logInit" data-id="2" data-title="管理员日志" class="site-demo-active"
                       data-type="tabAdd">
                        <i class="layui-icon layui-icon-read"></i> 管理员日志
                    </a>
                </li>
                <li class="layui-nav-item" id="student" style="text-align: center">
                    <a href="#" data-url="${pageContext.request.contextPath}/auser/auserInit" data-id="3" data-title="用户管理" class="site-demo-active"
                       data-type="tabAdd">
                        <i class="layui-icon layui-icon-user"></i> 用户管理
                    </a>
                </li>
                <li class="layui-nav-item" id="dept" style="text-align: center">
                    <a href="#" data-url="${pageContext.request.contextPath}/stat/addressInit" data-id="4" data-title="客户地区统计" class="site-demo-active"
                       data-type="tabAdd">
                        <i class="layui-icon layui-icon-chart-screen"></i> 客户地区统计
                    </a>
                </li>
                <li class="layui-nav-item" id="course" style="text-align: center">
                    <a href="#" data-url="${pageContext.request.contextPath}/aflower/aflowerInit" data-id="5" data-title="鲜花" class="site-demo-active"
                       data-type="tabAdd">
                        <i class="layui-icon layui-icon-read"></i> 鲜花
                    </a>
                </li>

                <li class="layui-nav-item" id="course" style="text-align: center">
                    <a href="#" data-url="${pageContext.request.contextPath}/aorder/qwe" data-id="7" data-title="订单查看"
                       class="site-demo-active">
                        <i class="layui-icon layui-icon-table"></i> 订单查看
                    </a>
                </li>
                <%--<li class="layui-nav-item" style="text-align: center">
                    <a href="javascript:;"><i class="layui-icon layui-icon-table"></i> 订单</a>
                    <dl class="layui-nav-child">--%>
                        <%--<dd><a href="#" data-url="${pageContext.request.contextPath}/aorder/aorderInit" data-id="7" data-title="订单查看"
                               class="site-demo-active">
                            <i class="layui-icon layui-icon-table"></i> 订单查看
                        </a>
                        </dd>
                        <dd>
                            <a href="#" data-url="${pageContext.request.contextPath}//" data-id="8" data-title="订单导出"
                               class="site-demo-active">
                                <i class="layui-icon layui-icon-table"></i> 订单导出
                            </a>
                        </dd>--%>
                   <%-- </dl>
                </li>--%>
            </ul>
        </div>
    </div>

    <div class="layui-body"
         style="background: url(img/bodyBg.jpg) no-repeat ;background-size: 100% 100%    ">
        <!-- 内容主体区域 -->
        <div class="layui-tab layui-tab-card" lay-filter="demo" lay-allowclose="true" style="">
            <ul class="layui-tab-title" style="background-color: rgba(255,255,255,0.1)">
                <li class="layui-this" lay-id="0"><i style="font-size: smaller"
                                                     class="layui-icon layui-icon-circle-dot"></i>首页
                </li>
            </ul>
            <div class="layui-tab-content" style="height:400px">
                <div class="layui-tab-item layui-show">
                    <div style="padding-top: 100px;padding-left:400px;width: 300px">
                        <table class="layui-table" style="background-color:rgba(255,255,255,0.1);font-weight: bolder"
                               lay-skin="line">
                            <tr>

                            </tr>

                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <div style="text-align: center">
            copy  © 2020村花
        </div>
    </div>
</div>

<div style="display: none;padding: 20px" id="saveOrUpdateDiv">

    <form class="layui-form" lay-filter="dataFrm" id="dataFrm">
        <div class="layui-col-md3 layui-col-xs5">
            <div class="layui-upload">
                <button type="button" class="layui-btn" id="test1">上传图片</button>
                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="demo1" src="${pageContext.request.contextPath}/static/photo/" style="width: 170px;height: 100px;">
                    <p id="demoText"></p>
                    <input type="hidden" name="photo" id="photo">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="text-align: center;padding-right: 120px">
                <button type="button"
                        class="layui-btn layui-btn-normal layui-btn-md layui-icon layui-icon-release layui-btn-radius"
                        lay-filter="doSubmit" lay-submit="">提交
                </button>
                <button type="reset"
                        class="layui-btn layui-btn-warm layui-btn-md layui-icon layui-icon-refresh layui-btn-radius">重置
                </button>
            </div>
        </div>
    </form>
</div>

<script src="${pageContext.request.contextPath}/static/Apage/layui/layui.js"></script>
<script src="${pageContext.request.contextPath}/static/Apage/js/home.js"></script>
<script>
    function currentTime(){
        var d=new Date(),str='';
        str+=d.getFullYear()+'年';
        str+=d.getMonth() + 1+'月';
        str+=d.getDate()+'日';
        str+=d.getHours()+'时';
        str+=d.getMinutes()+'分';
        str+= d.getSeconds()+'秒';
        return str;
    }

    setInterval(function(){$('#time').html(currentTime)},1000);

    layui.use(['upload','table'],function () {
        var upload=layui.upload;
        var table=layui.table;

        table.on('tip',function (obj) {
            if (obj.event == "userImg") { // 批量删除
                updateTX()
            }
        })

        var index;
        function updateTX() {
            // 弹出框
            index =  layer.open({
                type:1 // 1（页面层）
                , title:"修改头像"
                , content:$("#saveOrUpdateDiv")
                , area : ['700px', '500px']
                , success:function() {
                    // 页面数据要清除
                    $("#dataFrm")[0].reset()
                    $("#id1").val("")
                }
            })
        }


        var uploadInst = upload.render({
            elem: '#test1'
            ,url: '${pageContext.request.contextPath}/aflower/uploadImg'
            ,acceptMime : 'image/*'
            ,field:'f1'
            ,done:function (res) {
                //上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }

                //上传成功
                $("#demo1").attr("src",res.data.src)
                $("#photo").val(res.data.src)

            }
        })
    })

</script>
</body>
</html>
